package com.sgcc.ln.pmos.e_ln_home.adapter;

import android.content.Context;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.sgcc.pmos.nativesdk.R;
import com.sgcc.ln.pmos.e_ln_home.bean.FileBean;
import com.sgcc.ln.pmos.e_ln_home.bean.InformationDisclosure2Bean;

public class InforDiscloFourStepAdapter extends BaseQuickAdapter<InformationDisclosure2Bean.DataBean, BaseViewHolder> {


    private Context mContext;

    public InforDiscloFourStepAdapter(Context context) {
        super(R.layout.layout_infor_disclo_second_step_child_item);
        mContext = context;
    }

    public interface OnItemClickListener {
        //条目点击
        void itemClickListener(int position, InformationDisclosure2Bean.DataBean bean);
    }

    private OnItemClickListener mOnItemClickListener;

    public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
        this.mOnItemClickListener = onItemClickListener;
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, InformationDisclosure2Bean.DataBean bean) {
        baseViewHolder.setText(R.id.tv_child_name, bean.getLabel());
        baseViewHolder.getView(R.id.ll_child_item).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (mOnItemClickListener != null) {
                    mOnItemClickListener.itemClickListener(getItemPosition(bean), bean);
                }
            }
        });
    }


}
